# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年08月24日
"""
from docx import Document
from docx.enum.section import WD_ORIENTATION,WD_SECTION_START # 导入节方向和分布符类型


file = Document() # 新建文档
file.add_paragraph() # 添加一个空白段落
sec1 = file.add_section(start_type=WD_SECTION_START.CONTINUOUS) # 添加横向页的连续分页符,笔记11.3
sec1.orientation = WD_ORIENTATION.LANDSCAPE # 设置横向
wh, ht = sec1.page_width, sec1.page_height
sec1.page_width = ht
sec1.page_height = wh

file.add_paragraph() # 添加第二个空白段落
sec1 = file.add_section(start_type=WD_SECTION_START.CONTINUOUS) #添加连续分页符
sec1.orientation = WD_ORIENTATION.PORTRAIT
wh, ht = sec1.page_width, sec1.page_height
sec1.page_width = ht
sec1.page_height = wh

file.save('./练习/22结果01.docx')




